package com.gmail.volodymyrdotsenko.rooaddon.simpleweb;

import java.util.Set;

import org.springframework.roo.model.JavaType;

/**
 * Interface of operations this add-on offers. Typically used by a command type
 * or an external add-on.
 * 
 * @since 1.1
 */
public interface SimplewebOperations {

	/**
	 * Indicate commands should be available
	 * 
	 * @return true if it should be available, otherwise false
	 */
	boolean isCommandAvailable();

	/**
	 * Creates a new Spring MVC controller which will be automatically
	 * scaffolded.
	 * <p>
	 * Request mappings assigned by this method will always commence with "/"
	 * and end with "/**". You may present this prefix and/or this suffix if you
	 * wish, although it will automatically be added should it not be provided.
	 * 
	 * @param controller
	 *            the controller class to create (required)
	 * @param entity
	 *            the entity this controller should edit (required)
	 * @param disallowedOperations
	 *            specify a set of disallowed operation names (required, but can
	 *            be empty)
	 * @param path
	 *            the path which the controller should be accessible via REST
	 *            requests
	 */
	void createAutomaticController(JavaType controller, JavaType entity,
			Set<String> disallowedOperations, String path);
}